/**
 * 配置
 * @this ErrorNullInfo: 需要自己实现input部分
 *
 * @flow
 * -------
 *
 */
import React, { Component } from 'react'
import {
  StyleSheet,
  View,
  Text,
  Image,
} from 'react-native'

import PropTypes from 'prop-types'

import CommonColor from '../../../../styles/RXColor'

const icon_tip_red = null

export default class ErrorNullInfo extends Component {
  static propTypes = {
    ...View.propTypes,
    hit: PropTypes.string,
    hitStyle: PropTypes.any,
  }

  static defaultProps = {
    ...View.defaultProps,
    hit: '该信息不能为空',
    hitStyle: {},
  }

  render() {
    const { hit, hitStyle } = this.props
    return (
      <View style={[styles.container, hitStyle]}>
        <Image source={icon_tip_red} />
        <Text style={styles.text}>{hit}</Text>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'row',
    justifyContent: 'flex-end',
    alignItems: 'center',
  },
  image: {
    width: 13,
    height: 13,
  },
  text: {
    fontSize: 15,
    color: CommonColor.TextRed,
  },
})